/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

/* 容器布局 */
.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
    box-shadow: 0 0 30px rgba(0,0,0,0.1);
}

/* 顶部导航 */
.header {
    background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
    color: white;
    padding: 20px 30px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    font-size: 2em;
    margin-bottom: 5px;
}

.logo p {
    opacity: 0.8;
    font-size: 0.9em;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255,255,255,0.1);
    border-radius: 20px;
    font-size: 0.9em;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fbbf24;
    animation: pulse 2s infinite;
}

.status-dot.healthy {
    background: #10b981;
}

.status-dot.error {
    background: #ef4444;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* 导航标签 */
.nav-tabs {
    display: flex;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    overflow-x: auto;
}

.nav-tab {
    background: none;
    border: none;
    padding: 15px 25px;
    cursor: pointer;
    font-size: 0.95em;
    color: #64748b;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.nav-tab:hover {
    background: #e2e8f0;
    color: #475569;
}

.nav-tab.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
    background: white;
}

/* 标签页内容 */
.tab-content {
    display: none;
    padding: 30px;
    min-height: 600px;
}

.tab-content.active {
    display: block;
}

/* 仪表板网格 */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
}

/* 卡片样式 */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.card-header {
    background: #f8fafc;
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    font-size: 1.1em;
    color: #374151;
}

.card-body {
    padding: 20px;
}

/* 按钮样式 */
.btn {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8em;
}

.btn-secondary {
    background: #6b7280;
}

.btn-secondary:hover {
    background: #4b5563;
}

.btn-success {
    background: #10b981;
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: #ef4444;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-primary {
    background: #3b82f6;
}

/* 区域标题 */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e2e8f0;
}

.section-header h2 {
    color: #374151;
    font-size: 1.5em;
}

.section-actions {
    display: flex;
    gap: 10px;
}

/* 数据列表 */
.data-list {
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

/* 加载状态 */
.loading {
    text-align: center;
    padding: 40px;
    color: #6b7280;
    font-style: italic;
}

/* 状态标签 */
.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 500;
}

.status-badge.active {
    background: #dcfce7;
    color: #166534;
}

.status-badge.inactive {
    background: #fef2f2;
    color: #991b1b;
}

.status-badge.pending {
    background: #fef3c7;
    color: #92400e;
}

/* 健康状态网格 */
.health-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.health-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #f8fafc;
    border-radius: 8px;
}

.health-label {
    font-weight: 500;
    color: #374151;
}

.health-value {
    color: #6b7280;
}

/* 服务状态网格 */
.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.service-item {
    padding: 15px;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 4px solid #e2e8f0;
}

.service-item .status-badge.active {
    border-left-color: #10b981;
}

.service-item .status-badge.inactive {
    border-left-color: #ef4444;
}

.service-name {
    font-weight: 600;
    margin-bottom: 8px;
    color: #374151;
}

.service-message {
    font-size: 0.8em;
    color: #6b7280;
    margin-top: 5px;
}

/* 统计信息网格 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.stat-item {
    text-align: center;
    padding: 20px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.stat-number {
    font-size: 2em;
    font-weight: 700;
    color: #3b82f6;
    margin-bottom: 5px;
}

.stat-label {
    color: #6b7280;
    font-size: 0.9em;
}

/* 活动列表 */
.activity-list {
    max-height: 300px;
    overflow-y: auto;
}

.activity-item {
    padding: 12px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-time {
    font-size: 0.8em;
    color: #6b7280;
    min-width: 120px;
}

.activity-content {
    flex: 1;
    margin: 0 15px;
    color: #374151;
}

.activity-type {
    font-size: 0.8em;
    padding: 2px 8px;
    background: #e2e8f0;
    border-radius: 12px;
    color: #4b5563;
}

/* 通知样式 */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.notification {
    background: white;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-left: 4px solid #3b82f6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-width: 300px;
    animation: slideIn 0.3s ease;
}

.notification-success {
    border-left-color: #10b981;
}

.notification-error {
    border-left-color: #ef4444;
}

.notification-warning {
    border-left-color: #f59e0b;
}

.notification button {
    background: none;
    border: none;
    font-size: 1.2em;
    cursor: pointer;
    color: #6b7280;
    margin-left: 15px;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 错误和无数据状态 */
.error {
    color: #ef4444;
    text-align: center;
    padding: 20px;
    font-style: italic;
}

.no-data {
    color: #6b7280;
    text-align: center;
    padding: 20px;
    font-style: italic;
}

/* 数据表格样式 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.data-table th,
.data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.data-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #374151;
    font-size: 0.9em;
}

.data-table tr:hover {
    background: #f8fafc;
}

/* 服务器列压缩样式 */
.data-table .server-cell {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.85em;
    color: #6b7280;
}

/* 状态选择器样式 */
.form-group select[name="status"] {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 2px solid #e2e8f0;
    font-weight: 500;
}

.form-group select[name="status"]:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background: white;
}

.form-group select[name="status"] option {
    padding: 8px 12px;
    font-weight: 500;
}

.table-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.table-header h3 {
    color: #374151;
    font-size: 1.2em;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    opacity: 1;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 0;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal.show .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.2em;
    font-weight: 600;
    color: #374151;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: #6b7280;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.modal-close:hover {
    background: #f3f4f6;
}

.modal-body {
    padding: 25px;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #374151;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9em;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

/* 详情显示样式 */
.detail-item {
    display: flex;
    margin-bottom: 15px;
    align-items: flex-start;
}

.detail-item label {
    font-weight: 600;
    color: #374151;
    min-width: 100px;
    margin-right: 15px;
}

.content-text {
    background: #f8fafc;
    padding: 8px 12px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    word-break: break-all;
}

/* 系统设置样式 */
.settings-sections {
    display: grid;
    gap: 25px;
}

.settings-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    border: 1px solid #e2e8f0;
}

.settings-section h3 {
    margin-bottom: 20px;
    color: #374151;
    font-size: 1.1em;
}

.status-grid,
.performance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.status-item,
.metric-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
}

.progress-bar {
    position: relative;
    width: 100px;
    height: 20px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #059669);
    transition: width 0.3s ease;
}

.progress-bar span {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.8em;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.action-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* 系统指标样式 */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.metric-card {
    background: #f8fafc;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
}

.metric-label {
    font-size: 0.9em;
    color: #6b7280;
    margin-bottom: 8px;
}

.metric-value {
    font-size: 1.5em;
    font-weight: 600;
    color: #374151;
    margin-bottom: 10px;
}

.metric-bar {
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
}

.metric-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #059669);
    transition: width 0.3s ease;
}

.metric-trend {
    font-size: 0.8em;
    padding: 2px 8px;
    border-radius: 12px;
    margin-top: 5px;
    display: inline-block;
}

.metric-trend.up {
    background: #dcfce7;
    color: #166534;
}

.metric-trend.down {
    background: #fee2e2;
    color: #991b1b;
}

.metric-trend.stable {
    background: #f3f4f6;
    color: #374151;
}

/* WebSocket状态样式 */
.websocket-status {
    padding: 10px 0;
}

.status-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.status-item {
    text-align: center;
}

.status-label {
    font-size: 0.9em;
    color: #6b7280;
    margin-bottom: 5px;
}

.status-value {
    font-size: 1.8em;
    font-weight: 600;
    color: #374151;
}

.client-list {
    border-top: 1px solid #e5e7eb;
    padding-top: 15px;
}

.client-header {
    font-weight: 600;
    color: #374151;
    margin-bottom: 10px;
}

.client-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
}

.client-id {
    font-weight: 500;
    color: #374151;
}

.client-connected {
    font-size: 0.8em;
    color: #6b7280;
}

.no-clients {
    text-align: center;
    color: #9ca3af;
    font-style: italic;
    padding: 20px 0;
}

/* 批量操作样式 */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 5px;
}

.dropdown-toggle:hover {
    background: #2563eb;
}

.dropdown-toggle::after {
    content: '▼';
    font-size: 0.7em;
    margin-left: 5px;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    min-width: 160px;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 8px 16px;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    font-size: 0.9em;
    color: #374151;
    transition: background 0.2s ease;
}

.dropdown-item:hover {
    background: #f3f4f6;
}

.dropdown-item:first-child {
    border-radius: 6px 6px 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 6px 6px;
}

.batch-selection {
    background: #f0f9ff;
    border: 1px solid #0ea5e9;
    border-radius: 6px;
    padding: 10px 15px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.selection-info {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 0.9em;
    color: #0c4a6e;
}

.client-info {
    display: flex;
    flex-direction: column;
}

.client-name {
    font-weight: 500;
    color: #374151;
}

.client-id {
    font-size: 0.8em;
    color: #6b7280;
}

/* 复选框样式 */
.subscription-checkbox,
#selectAllCheckbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* 系统设置页面样式 */
.system-monitoring {
    margin-bottom: 30px;
}

.monitoring-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.system-settings-section {
    background: #f8fafc;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #e5e7eb;
}

.system-settings-section h3 {
    margin: 0 0 20px 0;
    color: #374151;
    font-size: 1.2em;
    font-weight: 600;
}

/* 模型状态下拉框样式 */
.status-select {
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 0.9em;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
}

.status-select:hover {
    border-color: #9ca3af;
}

.status-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.status-select:disabled {
    background: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
}

/* 状态选项颜色 */
.status-select option[value="draft"] {
    color: #6b7280;
}

.status-select option[value="testing"] {
    color: #d97706;
}

.status-select option[value="published"] {
    color: #059669;
}

.status-select option[value="deprecated"] {
    color: #dc2626;
}

.status-select option[value="archived"] {
    color: #6b7280;
}

.status-select option[value="removed"] {
    color: #dc2626;
}

.status-select option[value="maintenance"] {
    color: #7c3aed;
}

.status-select option[value="suspended"] {
    color: #f59e0b;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .monitoring-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .system-settings-section {
        padding: 15px;
        margin: 0 10px;
    }
}

@media (max-width: 768px) {
    .container {
        margin: 0;
        border-radius: 0;
    }

    .header-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .nav-tabs {
        flex-wrap: wrap;
    }

    .nav-tab {
        flex: 1;
        min-width: 120px;
    }

    .tab-content {
        padding: 20px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .section-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    .section-actions {
        justify-content: center;
    }

    .health-grid,
    .service-grid,
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .activity-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .activity-time {
        min-width: auto;
    }

    .notification-container {
        left: 10px;
        right: 10px;
    }

    .notification {
        min-width: auto;
    }

    .modal-content {
        width: 95%;
        margin: 20px;
    }

    .form-actions {
        flex-direction: column;
    }

    .detail-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .detail-item label {
        min-width: auto;
        margin-bottom: 5px;
    }

    .action-buttons {
        justify-content: center;
    }

    .status-grid,
    .performance-grid {
        grid-template-columns: 1fr;
    }
}

/* ==================== 模态框样式 ==================== */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    opacity: 1;
}

.modal-dialog {
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal.show .modal-dialog {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6b7280;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.modal-close:hover {
    background-color: #f3f4f6;
    color: #374151;
}

.modal-content {
    padding: 20px;
}

/* ==================== 表单样式 ==================== */

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #374151;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

/* ==================== 数据表格样式 ==================== */

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e5e7eb;
}

.table-header h3 {
    margin: 0;
    color: #1f2937;
    font-size: 1.25rem;
}

.table-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.data-table th {
    background: #f9fafb;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f3f4f6;
    color: #4b5563;
}

.data-table tr:hover {
    background-color: #f9fafb;
}

.data-table tr:last-child td {
    border-bottom: none;
}

/* 代码样式 */
code {
    background: #f1f5f9;
    color: #475569;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.85em;
}

/* ==================== 状态徽章样式 ==================== */

.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.model-type-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-transform: capitalize;
}

.model-type-badge.detection {
    background-color: #dbeafe;
    color: #1e40af;
}

.model-type-badge.segmentation {
    background-color: #f3e8ff;
    color: #7c3aed;
}

.model-type-badge.classification {
    background-color: #dcfce7;
    color: #166534;
}

.model-type-badge.pose {
    background-color: #fef3c7;
    color: #92400e;
}

.status-badge.draft {
    background-color: #f3f4f6;
    color: #6b7280;
}

.status-badge.testing {
    background-color: #fef3c7;
    color: #92400e;
}

.status-badge.published {
    background-color: #d1fae5;
    color: #065f46;
}

.status-badge.deprecated {
    background-color: #fee2e2;
    color: #991b1b;
}

.status-badge.archived {
    background-color: #f3f4f6;
    color: #6b7280;
}

.status-badge.removed {
    background-color: #fee2e2;
    color: #991b1b;
}

.status-badge.maintenance {
    background-color: #e0e7ff;
    color: #3730a3;
}

.status-badge.suspended {
    background-color: #fef3c7;
    color: #92400e;
}

.status-badge.warning {
    background-color: #fef3c7;
    color: #92400e;
}

.status-badge.info {
    background-color: #dbeafe;
    color: #1e40af;
}

/* ==================== 按钮尺寸变体 ==================== */

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 4px;
}

/* ==================== 详情显示样式 ==================== */

.notification-detail,
.detail-item {
    margin-bottom: 15px;
}

.detail-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.detail-item label {
    font-weight: 600;
    color: #374151;
    min-width: 80px;
    margin: 0;
}

.detail-item span {
    color: #4b5563;
}

.content-text {
    background: #f9fafb;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ==================== 系统设置样式 ==================== */

.system-settings {
    max-width: 800px;
}

.settings-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.settings-section h3 {
    margin: 0 0 15px 0;
    color: #1f2937;
    font-size: 1.1rem;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.status-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.status-item label {
    font-weight: 500;
    color: #374151;
    font-size: 14px;
}

.status-item span {
    color: #4b5563;
}

.service-status {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.performance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.metric-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.metric-item label {
    font-weight: 500;
    color: #374151;
    font-size: 14px;
}

.progress-bar {
    position: relative;
    height: 20px;
    background: #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #1d4ed8);
    border-radius: 10px;
    transition: width 0.3s ease;
}

.progress-bar span {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    font-weight: 600;
    color: #374151;
}

.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* ==================== 响应式表格 ==================== */

@media (max-width: 768px) {
    .modal-dialog {
        width: 95%;
        margin: 20px;
    }
    
    .table-container {
        font-size: 14px;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px 12px;
    }
    
    .performance-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        justify-content: center;
    }
}

/* ==================== 模型状态相关样式 ==================== */

/* 模型状态统计 */
.model-status-stats {
    margin-bottom: 30px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.stats-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.detail-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.detail-section h4 {
    margin-bottom: 15px;
    color: #495057;
    font-size: 1.1em;
}

.status-distribution,
.type-distribution {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.status-item,
.type-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.status-label,
.type-label {
    font-weight: 500;
    color: #495057;
}

.status-count,
.type-count {
    font-weight: 600;
    color: #007bff;
}

/* 模型状态列表 */
.model-status-list {
    margin-top: 20px;
}

/* 模型状态详情模态框 */
.model-status-details {
    max-width: 800px;
}

.model-status-details .detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
}

.performance-metrics,
.system-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.metric-item,
.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

.metric-key,
.info-key {
    font-weight: 500;
    color: #495057;
    font-size: 0.9em;
}

.metric-value,
.info-value {
    color: #6c757d;
    font-size: 0.9em;
    word-break: break-all;
}

.error-message {
    color: #dc3545;
    background: #f8d7da;
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid #f5c6cb;
    font-size: 0.9em;
}

/* 状态徽章样式 */
.status-badge.active {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-badge.loaded {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.status-badge.unloaded {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-badge.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 筛选下拉菜单 */
.filter-dropdown {
    position: relative;
    display: inline-block;
}

.filter-dropdown .dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    min-width: 300px;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 15px;
    margin-top: 5px;
}

.filter-dropdown .dropdown-item {
    display: block;
    padding: 8px 0;
    border-bottom: 1px solid #f8f9fa;
}

.filter-dropdown .dropdown-item:last-child {
    border-bottom: none;
}

.filter-dropdown label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #495057;
    font-size: 0.9em;
}

.filter-dropdown input,
.filter-dropdown select {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.9em;
}

.filter-dropdown .btn {
    margin-top: 10px;
    margin-right: 8px;
}

/* ==================== 模型分发样式 ==================== */

/* 分发表单样式 */
.dispatch-form-section {
    margin-bottom: 30px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #2d3748;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-help {
    font-size: 12px;
    color: #718096;
    margin-top: 4px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

/* 分发状态样式 */
.dispatch-status-section,
.available-clients-section {
    margin-bottom: 30px;
}

.dispatch-item {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    transition: all 0.3s ease;
}

.dispatch-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.dispatch-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.dispatch-header h4 {
    color: #2d3748;
    font-size: 1.2em;
    margin: 0;
}

.dispatch-details {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.progress-bar {
    position: relative;
    background: #e2e8f0;
    border-radius: 8px;
    height: 24px;
    overflow: hidden;
}

.progress-fill {
    background: linear-gradient(90deg, #4299e1, #63b3ed);
    height: 100%;
    transition: width 0.3s ease;
    border-radius: 8px;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: 600;
    font-size: 12px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.dispatch-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.info-item {
    font-size: 14px;
    color: #4a5568;
}

.info-item strong {
    color: #2d3748;
}

.error-message {
    color: #e53e3e;
    font-size: 14px;
    margin-top: 8px;
    padding: 8px;
    background: #fed7d7;
    border-radius: 6px;
    border-left: 4px solid #e53e3e;
}

/* 客户端列表样式 */
.client-item {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
}

.client-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.client-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.client-header h4 {
    color: #2d3748;
    font-size: 1.1em;
    margin: 0;
}

.client-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px;
}

/* 状态徽章样式 */
.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-pending {
    background: #fef5e7;
    color: #d69e2e;
    border: 1px solid #f6e05e;
}

.status-downloading {
    background: #ebf8ff;
    color: #3182ce;
    border: 1px solid #90cdf4;
}

.status-success {
    background: #f0fff4;
    color: #38a169;
    border: 1px solid #9ae6b4;
}

.status-warning {
    background: #fffaf0;
    color: #dd6b20;
    border: 1px solid #fbd38d;
}

.status-error {
    background: #fed7d7;
    color: #e53e3e;
    border: 1px solid #feb2b2;
}

.status-cancelled {
    background: #f7fafc;
    color: #718096;
    border: 1px solid #cbd5e0;
}

.status-online {
    background: #f0fff4;
    color: #38a169;
    border: 1px solid #9ae6b4;
}

.status-unknown {
    background: #f7fafc;
    color: #718096;
    border: 1px solid #cbd5e0;
}

/* 空状态样式 */
.empty {
    text-align: center;
    color: #718096;
    font-style: italic;
    padding: 40px 20px;
    background: #f7fafc;
    border-radius: 12px;
    border: 2px dashed #e2e8f0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats-details {
        grid-template-columns: 1fr;
    }
    
    .model-status-details .detail-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-dropdown .dropdown-menu {
        min-width: 250px;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .dispatch-info {
        grid-template-columns: 1fr;
    }
    
    .client-details {
        grid-template-columns: 1fr;
    }
    
    .dispatch-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .client-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* 客户端选择样式 */
.client-selection-container {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    overflow: hidden;
}

.client-selection-header {
    background: #edf2f7;
    padding: 8px 12px;
    border-bottom: 1px solid #e2e8f0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
    color: #2d3748;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 8px;
    transform: scale(1.1);
}

.client-selection-list {
    max-height: 300px;
    overflow-y: auto;
    padding: 4px 8px;
}

.client-selection-item {
    display: flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 4px;
    margin-bottom: 2px;
    transition: background-color 0.2s;
}

.client-selection-item:hover {
    background: #e2e8f0;
}

.client-selection-item:last-child {
    margin-bottom: 0;
}

.client-selection-item input[type="checkbox"] {
    margin-right: 6px;
    transform: scale(1.0);
}

.client-selection-item label {
    flex: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0;
}

.client-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.client-name {
    font-weight: 500;
    color: #2d3748;
    font-size: 0.9em;
    line-height: 1.2;
}

.client-details {
    font-size: 0.8em;
    color: #718096;
    line-height: 1.1;
}

.client-status {
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 0.7em;
    font-weight: 500;
    line-height: 1.2;
}

.client-status.online {
    background: #c6f6d5;
    color: #22543d;
}

.client-status.offline {
    background: #fed7d7;
    color: #742a2a;
}

/* 客户端选择滚动条 */
.client-selection-list::-webkit-scrollbar {
    width: 6px;
}

.client-selection-list::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.client-selection-list::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

.client-selection-list::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* 客户端选择操作按钮 */
.client-selection-actions {
    padding: 8px 12px;
    background: #f1f5f9;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

.client-selection-actions .btn {
    padding: 6px 12px;
    font-size: 0.85em;
}

/* 目标客户端选择区域占据更多空间 */
.form-grid .form-group:has([for="dispatchTargetClients"]) {
    grid-column: 1 / -1;
}

/* 如果浏览器不支持:has选择器，使用类名方式 */
.form-grid .client-target-group {
    grid-column: 1 / -1;
}
